package chapter2.No2_3_volatile关键字.e使用原子类进行i加加操作;

import java.util.ArrayList;
import java.util.List;

/**
 * 原子类（AtomicInteger）实战
 * @author liujian
 * @version 2016/11/16 0016
 */
public class Main {
    public static void main(String[] args) {
        ServiceClass sc = new ServiceClass();
        List<MyThread> threadList = new ArrayList<MyThread>();
        for (int i = 0; i < 100; i++) {
            threadList.add(new MyThread(sc));
        }
        for (MyThread m : threadList) {
            m.start();
        }
    }
}
